package collection;

import java.util.ArrayList;
import java.util.Collection;

public class Test {
    public static void main(String[] args) {
        Point p = new Point(1,2);
        Collection c = new ArrayList();
        c.add(p);
        test(p,c);
        System.out.println("p:"+p);
        System.out.println("c:"+c);
    }
    public static void test(Point p,Collection c){
        p.setX(2);
        c.clear();
        p = new Point(3,4);
        c.add(p);
        c = new ArrayList();
        p = new Point(5,6);
        c.add(p);
        p.setX(7);

    }
}
